package itc.djchallenge;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class ChooseRoom extends Activity implements View.OnClickListener {

	Button bCreate;
	ListView lvRooms;
	ArrayList<String> roomNames;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_choose_room);
		
		bCreate = (Button) findViewById(R.id.bCreateRoom);
		bCreate.setOnClickListener(this);
		
		TabHost th = (TabHost) findViewById(R.id.tabhost);
		th.setup();
		
		TabSpec specs = th.newTabSpec("tag1");
		specs.setContent(R.id.tab1);
		specs.setIndicator("Choose a Room");
		th.addTab(specs);
		
		specs = th.newTabSpec("tag2");
		specs.setContent(R.id.tab2);
		specs.setIndicator("Create a new Room");
		th.addTab(specs);
		
		roomNames = new ArrayList<String>();
		roomNames.add("Rock N' Roll Room");
		roomNames.add("Dance");
		roomNames.add("Electro");
		roomNames.add("K POP");
		
		lvRooms = (ListView) findViewById(R.id.lvRooms);
		lvRooms.setAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_2, android.R.id.text1,
				roomNames));

	
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.bCreateRoom:
			Intent i =  new Intent(this, SelectSongs.class);
			startActivity(i);		
		}
	}


}
